public class Solution {
    public boolean isIsomorphic(String s, String t) {
        return isIsomorphicOp(s, t) && isIsomorphicOp(t, s);
    }
    public boolean isIsomorphicOp(String s,String t) {
        Map<Character, Character> map = new HashMap<>();
        int len = s.length();
        for(int i = 0; i < len; i++) {
            Character s1 = map.get(s.charAt(i));
            if(s1 == null) {
                map.put(s.charAt(i), t.charAt(i));
            } else if(!s1.equals(t.charAt(i))) {
                return false;
            }
        }
        return true;
    }
}